<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Netty 高性能网络框架应用场景</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            border-color: #667eea;
        }
        
        .section-title {
            position: relative;
            display: inline-block;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 0;
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg, #667eea, #764ba2);
            border-radius: 2px;
        }
        
        .feature-icon {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .mermaid {
            background: white;
            padding: 2rem;
            border-radius: 1rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        }
        
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            margin-top: -0.2rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
        
        .scenario-number {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.2rem;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center animate-fadeInUp">
            <h1 class="text-5xl md:text-6xl font-bold mb-6">
                <i class="fas fa-network-wired mr-4"></i>Netty 框架
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">高性能异步事件驱动网络框架的应用场景探索</p>
            <div class="flex justify-center space-x-8 text-lg">
                <div class="flex items-center">
                    <i class="fas fa-rocket mr-2"></i>
                    <span>高性能</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-bolt mr-2"></i>
                    <span>低延迟</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-layer-group mr-2"></i>
                    <span>高并发</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-16 px-6">
        <div class="max-w-4xl mx-auto bg-white rounded-2xl shadow-xl p-10">
            <p class="text-lg leading-relaxed text-gray-700">
                <span class="drop-cap">N</span>etty 是一个高性能的异步事件驱动网络框架，它在很多高性能和高并发的网络应用中被广泛使用。Netty 的高性能、灵活性和广泛的协议支持使其成为许多需要处理高并发和低延迟网络通信的应用程序的首选框架。
            </p>
        </div>
    </section>

    <!-- Architecture Visualization -->
    <section class="py-16 px-6 bg-gray-50">
        <div class="max-w-6xl mx-auto">
            <h2 class="section-title text-3xl font-bold text-gray-800 mb-12">Netty 架构概览</h2>
            <div class="mermaid">
                graph TB
                    A[Netty 框架] --> B[事件驱动模型]
                    A --> C[异步非阻塞 I/O]
                    A --> D[高性能特性]
                    
                    B --> E[EventLoop]
                    B --> F[ChannelHandler]
                    
                    C --> G[NIO]
                    C --> H[Epoll]
                    
                    D --> I[零拷贝]
                    D --> J[内存池]
                    
                    style A fill:#667eea,stroke:#fff,stroke-width:3px,color:#fff
                    style B fill:#9f7aea,stroke:#fff,stroke-width:2px,color:#fff
                    style C fill:#9f7aea,stroke:#fff,stroke-width:2px,color:#fff
                    style D fill:#9f7aea,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </div>
    </section>

    <!-- Application Scenarios -->
    <section class="py-16 px-6">
        <div class="max-w-6xl mx-auto">
            <h2 class="section-title text-3xl font-bold text-gray-800 mb-12">核心应用场景</h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- Scenario 1 -->
                <div class="card-hover bg-white rounded-xl p-8 shadow-lg">
                    <div class="flex items-start mb-4">
                        <div class="scenario-number mr-4">1</div>
                        <h3 class="text-2xl font-bold text-gray-800">高并发 Web 服务器</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <i class="fas fa-bullseye feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">场景描述</h4>
                                <p class="text-gray-600">处理大量并发的 HTTP 请求和响应。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-star feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">优势</h4>
                                <p class="text-gray-600">Netty 的高性能和低延迟特性使其非常适合构建高并发的 Web 服务器。通过事件驱动的模型和异步处理，Netty 能够高效地处理大量连接，而不会造成线程切换的开销。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-code feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">示例</h4>
                                <p class="text-gray-600">自定义的 HTTP 服务器、反向代理服务器等。</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Scenario 2 -->
                <div class="card-hover bg-white rounded-xl p-8 shadow-lg">
                    <div class="flex items-start mb-4">
                        <div class="scenario-number mr-4">2</div>
                        <h3 class="text-2xl font-bold text-gray-800">分布式系统</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <i class="fas fa-bullseye feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">场景描述</h4>
                                <p class="text-gray-600">构建需要高效网络通信的分布式系统组件。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-star feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">优势</h4>
                                <p class="text-gray-600">Netty 提供了丰富的协议支持和灵活的编解码机制，适合用于构建分布式系统中的通信协议和数据传输。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-code feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">示例</h4>
                                <p class="text-gray-600">分布式数据库、分布式缓存、消息中间件等。</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Scenario 3 -->
                <div class="card-hover bg-white rounded-xl p-8 shadow-lg">
                    <div class="flex items-start mb-4">
                        <div class="scenario-number mr-4">3</div>
                        <h3 class="text-2xl font-bold text-gray-800">实时通信应用</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <i class="fas fa-bullseye feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">场景描述</h4>
                                <p class="text-gray-600">实时数据传输和低延迟通信应用。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-star feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">优势</h4>
                                <p class="text-gray-600">Netty 的非阻塞 I/O 和高效的事件处理机制使其能够处理大量的实时数据流和低延迟通信。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-code feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">示例</h4>
                                <p class="text-gray-600">即时通讯系统（如聊天应用）、实时数据流处理、在线游戏等。</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Scenario 4 -->
                <div class="card-hover bg-white rounded-xl p-8 shadow-lg">
                    <div class="flex items-start mb-4">
                        <div class="scenario-number mr-4">4</div>
                        <h3 class="text-2xl font-bold text-gray-800">物联网（IoT）</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="flex items-start">
                            <i class="fas fa-bullseye feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">场景描述</h4>
                                <p class="text-gray-600">处理来自大量 IoT 设备的数据流。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-star feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">优势</h4>
                                <p class="text-gray-600">Netty 能够高效地处理大量并发的网络连接和数据流，适合用于 IoT 系统中需要处理海量设备数据的场景。</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-code feature-icon mt-1 mr-3"></i>
                            <div>
                                <h4 class="font-semibold text-gray-700">示例</h4>
                                <p class="text-gray-600">智能家居系统、工业监控系统等。</p>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Scenario 5 -->
                